﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CommandLib
{
    public sealed class Config
    {
        private const string KeyUrlImage = "UrlImage";
        private const string KeyFolderImage = "FolderImage";

        private const string KeyOnePayVitualPaymentClientURL = "OnePayVitualPaymentClientURL";
        private const string KeyOnePayUrlReturn = "OnePayUrlReturn";
        private const string KeyOnePaySecretKey = "OnePaySecretKey";
        private const string KeyOnePayAccessCode = "OnePayAccessCode";
        private const string KeyOnePayMerchantId = "OnePayMerchantId";

        private const string KeyFolderImageArtistHome = "FolderImageArtistHome";
        private const string KeyUrlImageReality = "UrlImageReality";
        private const string KeyUrlImageArtistHomeReality = "UrlImageArtistHomeReality";

        private const string KeyDiplayFromName = "DiplayFromName";
        private const string KeyFromEmail = "FromEmail";
        private const string KeyPassFromEmail = "PassFromEmail";
        private const string KeyEmailCC = "EmailCC";

        private const string KeyHost = "Host";
        private const string KeyPort = "Port";

        private const string KeyPayPalURL = "PayPalURL";
        private const string KeyPayPalUrlReturn = "PayPalUrlReturn";
        private const string KeyPayPalUrlCancel = "PayPalUrlCancel";

        private const string KeyUrlActiveAccount = "UrlActiveAccount";

        private string _urlImage { get; set; }
        private string _folderImage { get; set; }

        private string _onePayVitualPaymentClientURL { get; set; }
        private string _onePayUrlReturn { get; set; }
        private string _onePaySecretKey { get; set; }
        private string _onePayAccessCode { get; set; }
        private string _onePayMerchantId { get; set; }

        private string _folderImageArtistHome { get; set; }
        private string _urlImageReality { get; set; }
        private string _urlImageArtistHomeReality { get; set; }

        private string _displayFromName { get; set; }
        private string _fromEmail { get; set; }
        private string _passFromEmail { get; set; }

        private string _emailCC { get; set; }

        private string _host { get; set; }
        private string _port { get; set; }

        private string _payPalURL { get; set; }
        private string _payPalUrlReturn { get; set; }
        private string _payPalUrlCancel { get; set; }

        private string _urlActiveAccount { get; set; }

        public static string UrlImage { get { return Instance._urlImage; } }
        public static string FolderImage { get { return Instance._folderImage; } }

        public static string OnePayVitualPaymentClientURL { get { return Instance._onePayVitualPaymentClientURL; } }
        public static string OnePayUrlReturn { get { return Instance._onePayUrlReturn; } }
        public static string OnePaySecretKey { get { return Instance._onePaySecretKey; } }
        public static string OnePayAccessCode { get { return Instance._onePayAccessCode; } }
        public static string OnePayMerchantId { get { return Instance._onePayMerchantId; } }

        public static string FolderImageArtistHome { get { return Instance._folderImageArtistHome; } }
        public static string UrlImageReality { get { return Instance._urlImageReality; } }
        public static string UrlImageArtistHomeReality { get { return Instance._urlImageArtistHomeReality; } }

        public static string DiplayFromName { get { return Instance._displayFromName; } }
        public static string FromEmail { get { return Instance._fromEmail; } }
        public static string PassFromEmail { get { return Instance._passFromEmail; } }

        public static string EmailCC { get { return Instance._emailCC; } }

        public static string Host { get { return Instance._host; } }
        public static string Port { get { return Instance._port; } }

        public static string PayPalUrl { get { return Instance._payPalURL; } }
        public static string PayPalUrlReturn { get { return Instance._payPalUrlReturn; } }
        public static string PayPalUrlCancel { get { return Instance._payPalUrlCancel; } }

        public static string UrlActiveAccount { get { return Instance._urlActiveAccount; } }

        private static readonly Config Instance = new Config();        

        public Config()
        {
            _urlImage = ConfigSection.GetAppSetting(KeyUrlImage);
            _folderImage = ConfigSection.GetAppSetting(KeyFolderImage);

            _onePayVitualPaymentClientURL = ConfigSection.GetAppSetting(KeyOnePayVitualPaymentClientURL);
            _onePayUrlReturn = ConfigSection.GetAppSetting(KeyOnePayUrlReturn);
            _onePaySecretKey = ConfigSection.GetAppSetting(KeyOnePaySecretKey);
            _onePayAccessCode = ConfigSection.GetAppSetting(KeyOnePayAccessCode);
            _onePayMerchantId = ConfigSection.GetAppSetting(KeyOnePayMerchantId);

            _folderImageArtistHome = ConfigSection.GetAppSetting(KeyFolderImageArtistHome);
            _urlImageReality = ConfigSection.GetAppSetting(KeyUrlImageReality);
            _urlImageArtistHomeReality = ConfigSection.GetAppSetting(KeyUrlImageArtistHomeReality);

            _displayFromName = ConfigSection.GetAppSetting(KeyDiplayFromName);
            _fromEmail = ConfigSection.GetAppSetting(KeyFromEmail);
            _passFromEmail = ConfigSection.GetAppSetting(KeyPassFromEmail);

            _emailCC = ConfigSection.GetAppSetting(KeyEmailCC);

            _host = ConfigSection.GetAppSetting(KeyHost);
            _port = ConfigSection.GetAppSetting(KeyPort);

            _payPalURL = ConfigSection.GetAppSetting(KeyPayPalURL);
            _payPalUrlReturn = ConfigSection.GetAppSetting(KeyPayPalUrlReturn);
            _payPalUrlCancel = ConfigSection.GetAppSetting(KeyPayPalUrlCancel);
            _urlActiveAccount = ConfigSection.GetAppSetting(KeyUrlActiveAccount);
        }
    }
}
